<pro-header></pro-header>
<nz-card>

    <div nz-row>
        <div nz-col [nzSpan]="4" style="margin-bottom: 30px;">
            <button  nz-button  nzType="primary" routerLink="../add">新增Banner</button>
        </div>
    </div>


    <nz-table #nzTable [nzAjaxData]="data" [nzPageSize]="pagesize"
              [nzPageIndex]="pageCurrent"
              [nzTotal]="total"
              (nzPageIndexChange)="getlist($event)"
    >
        <thead nz-thead>
        <tr>
            <th nz-th><span>序号</span></th>
            <th nz-th><span>标题</span></th>
            <th nz-th><span>图片</span></th>
            <th nz-th><span>类型</span></th>
            <th nz-th><span>地址</span></th>
            <th nz-th><span>操作</span></th>
        </tr>
        </thead>
        <tbody nz-tbody>
        <tr nz-tbody-tr *ngFor="let item of nzTable.data; let i=index">
            <td nz-td>{{i+1}}</td>
            <td nz-td>{{item['title']}}</td>
            <td nz-td>
                <app-myimgload [srcimg]="item['img']"></app-myimgload>
            </td>
            <td nz-td [ngSwitch]="item['type']">
                <div *ngSwitchCase="1">外部跳转</div>
                <div *ngSwitchCase="2">内部跳转</div>
                <div *ngSwitchDefault>仅链接</div>
            </td>
            <td nz-td>{{item['url']}}</td>
            <td nz-td>
                <a [routerLink]="['../show',item['id']]">编辑</a>
                <span nz-table-divider></span>
                <a (click)="delVide(item)">删除</a>
            <td>
        </tr>

        </tbody>
    </nz-table>
</nz-card>
